﻿using System.Web.Mvc;
using SlamDunk.CMS.UI.Controllers;

namespace SlamDunk.CMS.UI.Areas.Admin.Controllers
{
    /// <summary>
    /// 后台首页控制器
    /// </summary>
    public class HomeController : BaseController
    {
        /// <summary>
        /// 后台管理首页视图
        /// </summary>
        /// <returns>视图</returns>
        public ActionResult Index()
        {
            if (OperateContext.Current.CurrentUser != null)
            {
                return this.View(OperateContext.Current.CurrentUser.ToViewModel());
            }
            else
            {
                return this.Content("<script>window.top.location.href='/Admin/User/Login';</script>");
            }
        }
    }
}
